<?php
namespace app\common\command;

use think\Db;
use think\console\Command;
use think\console\Input;
use think\console\Output;

class Secure extends Command{
    
    protected function configure()
    {
        $this->setName('secure')->setDescription('保险到期提醒');
    }
    
    protected function execute(Input $input, Output $output)
    {
        $wanTime = time() + 1296000;
        $num = Db::name('secure')->where(['notice'=>1,'secure_end'=>['<= time',$wanTime]])->setField('warn',1);
        $output->writeln('更新了'.$num.'条数据');
    }
}
